package constants;

import utils.Utils;

/**
 * Created by yangzhi on 2019/8/12.
 */
public class OrderDefault {

    /**
     * 订单状态：订单状态：0待提交，1待支付，2已支付，3待洗车(已入闸)，4洗车中，5洗车完成，6异常
     */
    public static final class status {
        public static final Integer zero = 0;
        public static final Integer one = 1;
        public static final Integer two = 2;
        public static final Integer three = 3;
        public static final Integer four = 4;
        public static final Integer five = 5;
        public static final Integer six = 6;
    }
    public static final class statusName {
        public static final String zero = "待提交";
        public static final String one = "待支付";
        public static final String two = "已支付";
        public static final String three = "待洗车";
        public static final String four = "洗车中";
        public static final String five = "洗车完成";
        public static final String six = "异常";
    }

    public static final class failReason {
        public static final Integer one = 1;
        public static final Integer two = 2;
        public static final Integer three = 3;
    }
    public static final class failReasonName {
        public static final String one = "机器故障";
        public static final String two = "服务中紧急停止";
        public static final String three = "付款后用户主动放弃";
    }

    /**
     * 支付方式：0余额支付，1微信支付
     */
    public static final class payType {
        public static final Integer zero = 0;
        public static final Integer one = 1;
        public static final Integer two = 2;
        public static final Integer three = 3;
    }

    public static final class payTypeName {
        public static final String zero = "余额支付";
        public static final String one = "微信支付";
        public static final String two = "微信支付充值";
        public static final String three = "券支付";
    }

    public static final class nameType{
        public static final String status = "status";
        public static final String refundAudit = "refundAudit";
        public static final String refundStatus = "refundStatus";
        public static final String payType = "payType";
        public static final String carType = "carType";
        public static final String failReason = "failReason";

    }

    /**
     * 退款审核：1同意退款，2拒绝退款
     */
    public static final class refundAudit {
        public static final Integer two = 2;
        public static final Integer one = 1;
    }

    public static final class refundAuditName {
        public static final String one = "同意退款";
        public static final String two = "拒绝退款";
    }

    /**
     * 0 未知1 小轿车2 SUV3 面包车4 中巴车5 大巴车6 小货车7 大货车...
     */
    public static final class carType {
        public static final Integer zero = 0;
        public static final Integer one = 1;
        public static final Integer two = 2;
        public static final Integer three = 3;
        public static final Integer four = 4;
        public static final Integer five = 5;
        public static final Integer six = 6;
        public static final Integer seven = 7;
    }
    public static final class carTypeName {
        public static final String zero = "未知";
        public static final String one = "小轿车";
        public static final String two = "SUV";
        public static final String three = "面包车";
        public static final String four = "中巴车";
        public static final String five = "大巴车";
        public static final String six = "小货车";
        public static final String seven = "大货车";
    }
    /**
     * 退款状态：0无退款 1待退款 2已退款
     */
    public static final class refundStatus {
        public static final Integer zero = 0;
        public static final Integer one = 1;
        public static final Integer two = 2;
    }

    public static final class refundStatusName {
        public static final String zero = "无退款";
        public static final String one = "待退款";
        public static final String two = "已退款";

    }



    /**
     * 获取中文对应的描述
     * @param value
     * @param name
     * @return
     */
    public static String getResultName(Integer value,String name){
        String result ="";
        if (!Utils.isNullOrEmpty(name)){
             if (name.equals(nameType.status)){
                if(value.equals(status.zero)){
                    result =statusName.zero;
                }else if(value.equals(status.one)){
                    result =statusName.one;
                }else if(value.equals(status.two)){
                    result =statusName.two;
                }else if(value.equals(status.three)){
                    result =statusName.three;
                }else if(value.equals(status.four)){
                    result =statusName.four;
                }else if(value.equals(status.five)){
                    result =statusName.five;
                }else if(value.equals(status.six)){
                    result =statusName.six;
                }
            }else if(name.equals(nameType.refundAudit)){
                if(value.equals(refundAudit.two)){
                    result =refundAuditName.two;
                }else if(value.equals(refundAudit.one)){
                    result =refundAuditName.one;
                }
            }else if (name.equals(nameType.refundStatus)){
                if(value.equals(refundStatus.zero)){
                    result =refundStatusName.zero;
                }else if(value.equals(refundStatus.one)){
                    result =refundStatusName.one;
                }else if(value.equals(refundStatus.two)){
                    result =refundStatusName.two;
                }
            }else if(name.equals(nameType.payType)){
                 if(value.equals(payType.zero)){
                     result =payTypeName.zero;
                 }else if(value.equals(payType.one)){
                     result =payTypeName.one;
                 }else if(value.equals(payType.two)){
                     result =payTypeName.two;
                 }else if(value.equals(payType.three)){
                     result =payTypeName.three;
                 }
             }else if(name.equals(nameType.carType)){
                 if(value.equals(carType.zero)){
                     result =carTypeName.zero;
                 }else if(value.equals(carType.one)){
                     result =carTypeName.one;
                 }else if(value.equals(carType.two)){
                     result =carTypeName.two;
                 }else if(value.equals(carType.three)){
                     result =carTypeName.three;
                 }else if(value.equals(carType.four)){
                     result =carTypeName.four;
                 }else if(value.equals(carType.five)){
                     result =carTypeName.five;
                 }else if(value.equals(carType.six)){
                     result =carTypeName.six;
                 }else if(value.equals(carType.seven)){
                     result =carTypeName.seven;
                 }
             }else if(name.equals(nameType.failReason)){
                 if(value.equals(failReason.one)){
                     result =failReasonName.one;
                 }else if(value.equals(failReason.two)){
                     result =failReasonName.two;
                 }else if(value.equals(failReason.three)){
                     result =failReasonName.three;
                 }
             }
        }
        return  result;
    }
}
